Micron Document




Comment (computer programming)
part 18/37 · 66.0 KB total
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
block comment
*/
/+ start of outer block
/+ inner block +/
end of outer block +/

An example of nested blocks in Swift:

/* This is the start of the outer comment.
/* This is the nested comment. */
This is the end of the outer comment. */

Scripting

A pattern in many scripting languages is to delimit a line comment with #. Support for a block comment varies. Notable languages include: Bash, Raku, Ruby, Perl, PowerShell, Python and R.

An example in R:

# This is a comment
print("This is not a comment") # This is another comment

Block in Ruby

A block comment is delimited by =begin and =end that start a line. For example:

puts "not a comment"
# this is a comment
puts "not a comment"
=begin
whatever goes in these lines
is just for the human reader
=end
puts "not a comment"

Block in Perl

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────